$(document).ready(function(){
	access_token = $.getCookie("access_token");
	if($('.access_token').val() != "" && $('.access_token').val() != null){
		access_token = $('.access_token').val();
		if($.getCookie("access_token") == null){
			$.setCookie("access_token", access_token);
		}		
	}

	$('.cooperationAdd').click(function(){
		if($('.shopName').val() == "" || $('.shopAddress').val() == "" || $('.contacts').val() == "" || $('.mobile').val() == ""){
			$.popTagShow(1,"请完整填写资料","",null,null,null,null,"确定",$.popTagHide);
			return false;
		}
		$.getJSON("/"+server+"/cooperationAdd?access_token="+access_token+"&shopName="+$('.shopName').val()+"&shopAddress="+$('.shopAddress').val()+"&contacts="+$('.contacts').val()+"&mobile="+$('.mobile').val(),function(json){
			if(json.result == 1){
				$.popTagShow(3,"申请成功","",null,null,null,null,"确定",$.popTagHide);		
				$('.shopName').val("");
				$('.shopAddress').val("");
				$('.contacts').val("");
				$('.mobile').val("");
			}
			else{
				$.popTagShow(1,"申请失败","",null,null,null,null,"确定",$.popTagHide);		
			}
		})
	});
})